package players;

import cars.Car;

public class Player {
	private int turn;
	private String name;
	private Car car;
	private boolean playing;

	/**
	 * @param turn
	 * @param name
	 * @param car
	 */
	public Player(int turn, String name, Car car) {
		super();
		this.turn = turn;
		this.name = name;
		this.car = car;
		this.playing = true;
	}

	public boolean isPlaying() {
		return playing;
	}
	
	public void setPlaying(boolean playing) {
		this.playing = playing;
	}

	/**
	 * @return the turn
	 */
	public int getTurn() {
		return turn;
	}

	/**
	 * @param turn the turn to set
	 */
	public void setTurn(int turn) {
		this.turn = turn;
	}

	/**
	 * @return the name
	 */
	public String getName() {
		return name;
	}

	/**
	 * @param name the name to set
	 */
	public void setName(String name) {
		this.name = name;
	}

	/**
	 * @return the car
	 */
	public Car getCar() {
		return car;
	}

	/**
	 * @param car the car to set
	 */
	public void setCar(Car car) {
		this.car = car;
	}

	public void move(int option) {
	//	System.out.println("Cantidad de Lineas: "+car.getRace().getSegments().size());
		switch(option){
			case 1: car.moveUpLeft(); break;
			case 2: car.moveUp(); break;
			case 3: car.moveUpRight(); break;
			case 4: car.moveLeft(); break;
			case 5: car.moveCenter(); break;
			case 6: car.moveRight(); break;
			case 7: car.moveDownLeft(); break;
			case 8: car.moveDown(); break;
			case 9: car.moveDownRight(); break;
		}
		
	}

		
	
}
